/*
 * @Author: DUST
 * @Date: 2023-05-15 15:46:33
 * @LastEditors: DUST
 * @LastEditTime: 2023-05-31 13:50:52
 * @FilePath: \vite-project\src\store\index.ts
 * @Description: 
 * undefined
 */

import { createApp } from 'vue'; // 拿过来
import app from '../App' // 拿过来
import type { App } from 'vue';
import { createPinia } from 'pinia';
import piniaPersist from 'pinia-plugin-persist'
 
const store = createPinia(); // 创建pinia实例
 store.use(piniaPersist)
createApp(app).use(store) // 直接给他挂上边，就解决啦
// 全局注册 store
export function setupStore(app: App<Element>) {
  app.use(store); // 挂载pinia
}
export default store;